package com.chenfan.process.biz;

import com.chenfan.process.dto.ApprovalMapDTO;
import com.chenfan.process.entity.vo.ProcessDetailActiveVO;
import com.chenfan.process.vo.ApprovalVo;
import com.chenfan.process.vo.EntireProcessDetailVo;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * @author liuming
 * @date 2021/10/8
 */
public interface ProcessBizQuery {
    ProcessDetailActiveVO getProcessDetailList(ApprovalMapDTO approval);

    List<List<EntireProcessDetailVo>> getAllProcessList(Collection<Long> approvalIdList)
        throws ExecutionException, InterruptedException;

    List<ApprovalVo> getInstanceStatusList(String serviceName, String approvalTemplateCode, Long userId, Integer pageNum,
        Integer pageSize);

    default List<ApprovalVo> listInstanceStatusList(String serviceName, String approvalTemplateCode, List<Long> userIdList, Integer pageNum,
        Integer pageSize) {
        return listInstanceStatusList(serviceName, approvalTemplateCode, Collections.emptyList(), userIdList, pageNum, pageSize);
    }

    List<ApprovalVo> listInstanceStatusList(String serviceName, String approvalTemplateCode, List<String> approvalTemplateCodeList,
                                            List<Long> userIdList, Integer pageNum,Integer pageSize);

    Map<Long, String> mapApproval(Collection<Long> approvalIdList);

    String getApprovalTemplateDiagram(Long approvalId);
}
